package admin

import (
	"context"
	"server/internal/model"
	"server/internal/service"

	"server/api/admin/system"
)

func (c *ControllerSystem) ConfigList(ctx context.Context, req *system.ConfigListReq) (res *system.ConfigListRes, err error) {
	res = new(system.ConfigListRes)
	res.List, res.Total, err = service.SystemConfig().List(ctx, model.SystemConfigListInput{
		CategoryId: req.CategoryID,
		Name:       req.Name,
		Code:       req.Code,
		Page:       req.Page,
		PageSize:   req.PageSize,
	})
	return
}
